package org.tigris.mappedlexer.validator.implementation;

/**
 * Composite pattern validator.
 * 
 * @author zhisen.huang
 *
 */
public abstract class CompositeValidator extends AbstractValidator {

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	@Override
	public boolean validate(String str) throws UnsupportedOperationException {
		for (char chr : str.toCharArray()) {
			if (!validate(chr)) {
				return false;
			}
		}

		return true;
	}
}
